Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request expands the Copilot/AI chat UI to support interactive tool-result rendering and introduces an LLM model picker with per-workspace persistence, backed by new GraphQL queries for provider catalogs and defaults.
Changes:
- Add interactive AI chat “data parts” (connection creation/selection, property option selection, ask-user-question wizard, run-error surface) plus supporting stores/utilities.
- Introduce an LLM provider+model picker (with per-workspace “last used” persistence) and wire it into the Copilot panel/runtime state.
- Extend GraphQL/codegen inputs to include the AI gateway schema and generate client hooks for
aiDefaultModelandaiProviderCatalog.
Reviewed changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| client/src/shared/middleware/graphql.ts | Adds generated types/hooks for AI default model + provider catalog queries. |
| client/src/shared/components/copilot/utils/extractScriptFromDefinition.ts | Utility to locate a script parameter for a named node inside a JSON workflow definition. |
| client/src/shared/components/copilot/utils/extractScriptFromDefinition.test.ts | Unit tests for script extraction utility. |
| client/src/shared/components/copilot/stores/useCopilotToolResultHandlerRegistry.ts | New registry store for mapping tool results to client-side handlers. |
| client/src/shared/components/copilot/stores/useCopilotStore.ts | Stores per-conversation selected LLM provider/model and persists it through save/restore. |
| client/src/shared/components/copilot/stores/useCopilotCodeToolResultStore.ts | Stores the last updated workflow definition emitted by a code tool result. |
| client/src/shared/components/copilot/runtime-providers/CopilotRuntimeProvider.tsx | Injects environment/workspace/LLM selection into agent state; handles tool result and run-error events. |
| client/src/shared/components/copilot/CopilotPanel.tsx | Adds model picker, default-model query, dataComponents wiring, and preset suggestions. |
| client/src/shared/components/ai/model-picker/ModelPicker.tsx | New dropdown UI for selecting provider/model (plus “model by id” input). |
| client/src/shared/components/ai/model-picker/ModelPicker.test.tsx | Component tests for the model picker behavior. |
| client/src/shared/components/ai/model-picker/lastUsedModel.ts | LocalStorage persistence helpers for per-workspace last used model/provider. |
| client/src/shared/components/ai/model-picker/lastUsedModel.test.ts | Unit tests for last-used model persistence helpers. |
| client/src/shared/components/ai-chat/stores/useAiChatToolCallStore.ts | New store tracking tool-call lifecycle, progress, and cross-task cleanup. |
| client/src/shared/components/ai-chat/stores/useAiChatRetryableErrorStore.ts | New store for retryable error details. |
| client/src/shared/components/ai-chat/stores/useAiChatAskedQuestionsStore.ts | New in-memory store for answered ask-user-question flows keyed by fingerprint. |
| client/src/shared/components/ai-chat/stores/tests/useAiChatToolCallStore.test.ts | Tests for tool-call lifecycle and reset-for-task behavior. |
| client/src/shared/components/ai-chat/stores/tests/useAiChatRetryableErrorStore.test.ts | Tests for retryable error store behavior. |
| client/src/shared/components/ai-chat/messages/toToolResultDataPart.ts | Shared tool-result payload parsing/validation → assistant-ui data-part mapping. |
| client/src/shared/components/ai-chat/messages/tests/toToolResultDataPart.test.ts | Tests for tool-result data-part mapping and validation failures. |
| client/src/shared/components/ai-chat/messages/tests/SelectPropertyOptionMessage.test.tsx | Tests for property option selection UI behavior. |
| client/src/shared/components/ai-chat/messages/tests/CreateConnectionMessage.test.tsx | Tests for create-connection message UI behavior. |
| client/src/shared/components/ai-chat/messages/tests/AskUserQuestionMessage.test.tsx | Tests for ask-user-question wizard behavior (single/multi/wizard/other/threshold). |
| client/src/shared/components/ai-chat/messages/SelectPropertyOptionMessage.tsx | Renders select-property-option tool results as a ComboBox and submits selected value. |
| client/src/shared/components/ai-chat/messages/SelectConnectionMessage.tsx | Renders select-connection tool results as a dropdown of existing connections. |
| client/src/shared/components/ai-chat/messages/RunErrorMessage.tsx | New red callout UI for RUN_ERROR events. |
| client/src/shared/components/ai-chat/messages/humanizeAgentErrorMessage.ts | Utility to strip provider/Java envelopes into a user-readable run error. |
| client/src/shared/components/ai-chat/messages/CreateConnectionMessage.tsx | Renders create-connection tool results as a “Connect ” dialog button flow. |
| client/src/shared/components/ai-chat/messages/AskUserQuestionMessage.tsx | Wizard UI for ask-user-question tool results with persistence via fingerprint store. |
| client/src/shared/components/ai-chat/messages/aiChatDataComponents.tsx | Registers data-part component mapping for assistant-ui thread rendering. |
| client/src/pages/platform/workflow-editor/components/properties/components/property-code-editor/property-code-editor-dialog/hooks/usePropertyCodeEditorDialog.ts | Applies updateScriptComponentCode tool result back into the code editor after a Copilot turn. |
| client/src/graphql/platform/ai-providers/aiProviderCatalog.graphql | Adds aiProviderCatalog query document. |
| client/src/graphql/platform/ai-providers/aiDefaultModel.graphql | Adds aiDefaultModel query document. |
| client/codegen.ts | Includes AI gateway GraphQL schema in codegen sources. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ot runtime - SelectPropertyOptionMessage: fix missing space in opacity className, disable the picker when superseded, and resolve the picked option by its unique value instead of an ambiguous label match (label still drives search). - SelectConnectionMessage: fix missing space in opacity className. - ModelPicker: fall back to BrainCircuitIcon when a provider has no icon, and gate the 'Choose model by ID' affordance behind provider.supportsModelById. - CopilotRuntimeProvider: stop pre-adding an empty assistant message so a tool-result/run-error-only turn no longer leaves a blank bubble. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.